finding a and b in a piecewise function